<template>
<div class="header">
    <router-link to="/Fond"><span class="iconfont icon-xiangzuo"></span></router-link>
    <div class="middle">{{headline}}</div>
    <router-link to=""><span class="iconfont">...</span></router-link>
</div>
    
</template>

<script>

//chuang
export default {
    name:"HeaderEva",
    props:['msg'],
    data(){
        return{
            headline:"内容详情"

        }
    },
    mounted(){
        window.addEventListener("scroll",this.srcollMove);
    },
    destroyed(){
        window.removeEventListener("scroll",this.srcollMove);
    },
    methods:{
        srcollMove(){
            let scroll = document.body.scrollTop || document.documentElement.scrollTop;;
            if(scroll > 0){
                this.headline = this.msg.headLine;
            }else{
                this.headline = "内容详情"
            }
        }
    }
    
}
</script>

<style scoped>
.header{
    height: .4rem;
    width: 100%;
    background-color: white;
    display: flex;
    justify-content: space-between;
    line-height: .4rem;
    position: fixed;
    top: 0;
    
}
.iconfont{
    height: 100%;
    width: .4rem;
    display: block;
    text-align: center;
}
.middle{
    flex: 1;
    text-align: center;
    overflow: hidden;
}

</style>